38 research outputs found

    Low level conditional move optimization

    Get PDF
    The high level optimizations are becoming more and more sophisticated, the importance of low level optimizations should not be underestimated. Due to the changes in the inner architecture of modern processors, some optimization techniques may become more or less effective. Existing techniques need, from time to time, to be reconsidered, and new techniques, targeting these modern architectures, may emerge. Due to the growing instruction pipeline of modern processors, recovering after branch mis-predictions is becoming more expensive, and so avoiding that is becoming more critical. In this paper we introduce a novel approach to branch elimination using conditional move operations, namely the CMOVcc instruction group. The inappropriate use of these instructions may result in sensible performance regression, but in many cases they outperform the sequence of a conditional jump and an unconditional move instruction. Our goal is to analyze the usage of CMOVcc in different contexts on modern processors, and based on these results, propose a technique to automatically decide whether the conditional move or the sequence of a conditional jump and an unconditional move should be performed in a given situation

    Static Analysis for Divide-and-Conquer Pattern Discovery

    Get PDF
    Routines implementing divide-and-conquer algorithms are good candidates for parallelization. Their identifying property is that such a routine divides its input into "smaller" chunks, calls itself recursively on these smaller chunks, and combines the outputs into one. We set up conditions which characterize a wide range of d&c routine definitions. These conditions can be verified by static program analysis. This way d&c routines can be found automatically in existing program texts, and their parallelization based on semi-automatic refactoring can be facilitated. We work out the details in the context of the Erlang programming language

    Refactoring Erlang programs

    Get PDF
    This paper presents the model, the design principles and the prototype of a refactoring toolset for Erlang programs. With this toolset one can incrementally carry out programmer-guided meaning-preserving program transformations. Erlang is a mostly dynamically typed language, and many of its semantical rules are also dynamic. Therefore the main challenge in this research is to ensure the safety of (the statically performed) refactoring steps. The paper analyses the language constructs of Erlang with respect to refactoring. A novelty of the presented approach is that programs are represented, stored and manipulated in a relational database. This feature makes it possible to express refactoring steps in a fairly compact and comprehensible way. The proposed software development environment with the integrated refactoring tool provides multiple editing modes. These editing modes support changes ranging from fully controlled (allowing only meaning-preserving transformations) to uncontrolled (editing program text freely). Transformations are performed more safely and efficiently in an editing mode with higher control

    Parallelisation of Haskell programs by refactoring

    Get PDF
    We propose a refactoring tool for the Haskell programming language, capable of introducing parallelism to the code with reduced effort from the programmer. Haskell has many ways to express concurrency and parallelism. Moreover, Eden, a dialect of Haskell supports a wide range of features for parallel and distributed computations. After comparing a number of possibilities we have found that the Eval Monad, the Par Monad and the Eden language provide similar parallel performance. Our tool is able to introduce parallelism by turning certain syntactic forms into the application of algorithmic skeletons, which are implemented with the Eval Monad, the Par Monad and the Eden language

    High-level Multicore Programming with C++11

    Get PDF
    Nowadays, one of the most important challenges in programming is the efficient usage of multicore processors. All modern programming languages support multicore programming at native or library level. C++11, the next standard of the C++ programming language, also supports multithreading at a low level. In this paper we argue for some extensions of the C++ Standard Template Library based on the features of C++11. These extensions enhance the standard library to be more powerful in the multicore realm. Our approach is based on functors and lambda expressions, which are major extensions in the language. We contribute three case studies: how to efficiently compose functors in pipelines, how to evaluate boolean operators in parallel, and how to efficiently accumulate over associative functors

    Vibronic spectra of molecules – an experiment with a quantum computer simulator

    Get PDF
    In addition to the exciting fundamental questions of quantum computing and implementation possibilities of quantum computers, it is important to look for application areas of quantum computing, to point out practical cases which justify the need for this technology. Besides the wellknown qubit-based quantum computers, there are also devices based on other foundations that can surpass the capabilities of classical computers. Among these, devices operating on the basis of boson sampling have a naturally occurring application: the approximate calculation of the vibrational spectrum of molecules. Two separate research groups, Huh et al. [14] and Wang et al. [22] created quantum simulators based on boson sampling, which were successfully used to calculate the transition probabilities between specific states of small molecules. Following the methodology found in these two articles, this paper presents how the calculations of transition probabilities can be performed on a classical computer using a quantum computer simulator which is based on Gaussian boson sampling

    C++ Standard Template Library by infinite iterators

    Get PDF
    The C++ Standard Template Library (STL) is an essential part of pro- fessional C++ programs. STL is a type-safe template library that is based on the generic programming paradigm and helps to avoid some possible dangerous C++ constructs. With its usage, the efficiency, safety and quality of the code is increased. However, professional C++ programmers are eager for some missing STLrelated opportunities. For instance, infinite ranges are hardly supported by C++ STL. STL does not contain iterators that use a predicate during traversal. STL’s design is not good at all from the view of predicates. In this paper we present some extensions of C++ STL that supports effective generic programming. We show scenarios where these extensions can be used pretty gracefully. We present the implementation of our infinite iterators
    corecore